package com.eigaland.change_machine.business.setup_account

import androidx.databinding.ObservableField
import androidx.lifecycle.MutableLiveData
import com.eigaland.change_machine.APP
import com.eigaland.change_machine.displaymodel.HomeDisplayModel
import com.eigaland.change_machine.displaymodel.IDisplayModel
import com.eigland.eigaland_lib.base.BaseVM
import movie6.posprintercept2.extensions.customLaunch
import movie6.posprintercept2.extensions.getDeviceSec

public class SetUpAccountFragmentVM : BaseVM(){

    var repository = SetUpAccountFragmentRepository()

    var account = ObservableField<String>("")

    var pwd = ObservableField<String>("")

    var clickableStatus = MutableLiveData<Boolean>()

    var loginStatus = MutableLiveData<HomeDisplayModel>()


    fun cancel(){

    }

    fun login(){
        progressLoadingStatus.postValue(true)
        customLaunch({

           var result = repository.loginDevice(account.get()!!,pwd.get()!!,APP.app.getDeviceSec())
            loginStatus.postValue(result)
            progressLoadingStatus.postValue(false)

        },{
            progressLoadingStatus.postValue(false)
        },{})
    }


    override fun initData() {

    }

    override fun destroy() {

    }

    override fun saveData() {

    }

    override fun onResume() {

    }

}


